FROM php:7.2-fpm
ARG TZ=Asia/Shanghai
ENV TZ ${TZ}

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

#安装swoole
RUN pecl install swoole \
    && docker-php-ext-enable swoole;

#安装mysql
RUN docker-php-ext-install mysqli;

#安装redis
RUN printf "\n" | pecl install -o -f redis \
        &&  rm -rf /tmp/pear \
        &&  docker-php-ext-enable redis;

#安装pdo pdo_mysql
RUN docker-php-ext-install pdo \
        && docker-php-ext-install pdo_mysql

RUN usermod -u 1000 www-data

WORKDIR /var/www

CMD ["php-fpm"]

EXPOSE 9000